<!DOCTYPE html>
<html>

<head>
    <title>高德地图－运动迁徙</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.3&key=c75741b6f2144f1c55dddbb864d76b4b"></script>
    <style type="text/css">
        body,
        html,
        #map {
            height: 100%;
            margin: 0px;
            font: 12px Helvetica, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', Arial;
        }
    </style>
</head>

<body>
    <div id="map" tabindex="0"></div>
    <script type="text/javascript" src="../src/map/amap/CanvasLayer.js"></script>
    <script>
        var map = new AMap.Map('map', {
            zoom: 6,
            center: [112.03956, 26.063677]
        });
        map.setMapStyle('amap://styles/blue');

        var data = [{
            from: {
                city: '广州',
                lnglat: [113.270793, 23.135308]
            },
            to: {
                city: '衡山',
                lnglat: [112.612787, 27.317599]
            }
        }, {
            from: {
                city: '广州',
                lnglat: [113.270793, 23.135308]
            },
            to: {
                city: '北京',
                lnglat: [116.413554, 39.911013]
            }
        }, {
            from: {
                city: '广州',
                lnglat: [113.270793, 23.135308]
            },
            to: {
                city: '三亚',
                lnglat: [109.518646, 18.258217]
            }
        }, {
            from: {
                city: '广州',
                lnglat: [113.270793, 23.135308]
            },
            to: {
                city: '上海',
                lnglat: [121.480237, 31.236305]
            }
        }, {
            from: {
                city: '广州',
                lnglat: [113.270793, 23.135308]
            },
            to: {
                city: '韶关',
                lnglat: [113.603757, 24.816174]
            }
        }];

        var canvasOverlay = new CanvasLayer({
            map: map
        });
        console.log(canvasOverlay._element);
    </script>
</body>